package com.rpc.demo.provider;

import com.rpc.demo.myservice.HelloService;
import com.rpc.demo.myservice.impl.HelloServiceImpl;
import com.rpc.demo.pojo.URL;
import com.rpc.demo.registry.NativeRegistry;
import com.rpc.demo.tomcat.HttpServer;

public class ServiceProvider {
	public static void main(String[] args) {
		String hostname="localhost";
		Integer port = 8080;
		//1.注册服务
		NativeRegistry.register(HelloService.class.getName()
				,new URL(hostname,port), HelloServiceImpl.class);

		//2.启动tomcat,暴露服务
		HttpServer httpServer = new HttpServer();
		httpServer.start(hostname,port);
	}
}
